<template>
  <div>
     <TypeNav></TypeNav>
     <ListContainer></ListContainer>
     <Recommend></Recommend>
     <Rank/>
     <Like/>
     <Floor v-for="(floor,index) in floorList" :key="floor.id" :floor="floor" />
     <Brand/>
  </div>
</template>
<script>
//引入
import ListContainer from './ListContainer';
import Recommend from './Recommend'
import Rank from './Rank';
import Like from './Like'
import Floor from './Floor';
import Brand from './Brand';
import { mapState } from 'vuex';
export default {
  name: 'Home',
  //注册组件
  
  components:{
    ListContainer,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand
  },
  mounted() {
    //派发action获取floor的数据
    this.$store.dispatch('getFloorList')
    //测试:当用户登录成功,获取用户信息
    this.$store.dispatch('getUserInfo')
  },
   //获取仓库数据
  computed:{
    ...mapState({
       floorList:state=>state.home.floorList
    })
  }
}
</script>

<style scoped>

</style>
